@extends('layouts.app')
@section('content')
<div class="content">
    <a class="btn btn-info btn-sm" href="{{ redirect()->back()->getTargetUrl() }}"> 返回 </a>
    <br>
    <br>

    <div class="row">
        

        <div class="col-md-6">
            <div class="box box-success">
                <div class="panel-heading"> 编辑 </div>
                <div class="panel-body">

                    <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="{{ route('admin.template.store') }}">
                        <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
                        <input type="hidden" name="id" value="{{ $template->id }}"/>

                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">消息开始语</label>
                            <div class="col-xs-12 col-sm-8">
                                <textarea class="form-control editor" style="resize:none;" rows="5" name="first" cols="50">{{ $template->first }}</textarea>
                            </div>
                        </div>

                        @foreach($data as $key => $item)
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{{$key}}</label>
                            <div class="col-xs-12 col-sm-8">
                                <p class="form-control">{{$item}}</p>
                            </div>
                        </div>
                        @endforeach

                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">消息结束语</label>
                            <div class="col-xs-12 col-sm-8">
                                <textarea id="c-content" class="form-control editor" style="resize:none;" rows="5" name="remark" cols="50">{{ $template->remark }}</textarea>
                            </div>
                        </div>
                        <div class="form-group layer-footer">
                            <label class="control-label col-xs-12 col-sm-2"></label>
                            <div class="col-xs-12 col-sm-8">
                                <button type="submit" class="btn btn-success btn-embossed">确定</button>
                                <button type="reset" class="btn btn-default btn-embossed">重置</button>
                            </div>
                        </div>
                    </form>

                </div>
            </div>
        </div>
    </div>


</div>
@endsection
@push('scripts')
@endpush
